Skip to content

Open launch config dialog on Ctrl/cmd+click on launch shortcuts in Run As / Debug As menu - #3021

Open
SougandhS wants to merge 1 commit into
eclipse-platform:masterfrom
SougandhS:ConfigBeforeLaunch
Open

SougandhS wants to merge 1 commit into
eclipse-platform:masterfrom
SougandhS:ConfigBeforeLaunch

Conversation

@SougandhS

Copy link
Copy Markdown
Contributor

Adds an entry that opens the launch configuration dialog on a config with default settings for the current selection, so it can be edited before the first launch. This saves launching once, or creating a configuration by hand in Run/Debug Configs, just to change settings such as arguments or VM options. It also works for new files that have no configuration yet.

Screenshot 2026-10-13 at 11 36 34 AM Add

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

    54 files  ±0      54 suites  ±0   35m 5s ⏱️ -47s
 4 862 tests ±0   4 840 ✅ ±0   22 💤 ±0  0 ❌ ±0 
12 477 runs  ±0  12 323 ✅ ±0  154 💤 ±0  0 ❌ ±0 

Results for commit bdf2229. ± Comparison against base commit 2ba57cd.

♻️ This comment has been updated with latest results.

@iloveeclipse

Copy link
Copy Markdown
Member

Run Configurations... provided same? If not, usually one adds three dots after "simple"menu to indicate the "not simple" one opens dialog. So not "Configure before launch" but "JUnit Test..." Note also that for some files there can be different run configurations possible, so single "Configure before" will not work.

@SougandhS

Copy link
Copy Markdown
Contributor Author

Run Configurations... provided same?

No, it simply opens Run/Debug config..

So not "Configure before launch" but "JUnit Test..."

Will update it 👍

Note also that for some files there can be different run configurations possible, so single "Configure before" will not work.

Once a default config is created they can easily duplicate ri8 ?

@SougandhS

Copy link
Copy Markdown
Contributor Author

Updated 👍
image

@SougandhS

Copy link
Copy Markdown
Contributor Author

Hi @iloveeclipse, is this good to go ?

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Configuration creation loses shortcut-specific selection data, handles multiple types nondeterministically, and introduces ambiguous labels.

4 open findings
What changed in this PR

Adds pre-launch configuration actions to contextual Run As / Debug As menus.

Changes:

  • Adds configure-only launch shortcut actions.
  • Creates and opens default launch configurations.
  • Updates copyright years.
File Description
ContextualLaunchAction.java Adds configure menu entries.
LaunchShortcutAction.java Implements configure-only behavior.
DebugUIMessages.java Updates copyright year.
DebugUIMessages.properties Updates copyright year.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

new MenuItem(menu, SWT.SEPARATOR);
}
List<String> categories = new ArrayList<>();
List<LaunchShortcutExtension> configureShortcuts = new ArrayList<>();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this is needed.

/// @param typeIds the ids of the configuration types associated with the
/// shortcut
/// @return the selected type or `null` if there is none or the user cancelled
/// the selection

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just introduced markdown comments here since were now at JDK 25 min.. Hope its okay

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Bare configurations omit shortcut-specific settings for the current selection, breaking the feature for supported shortcuts such as MIDI files.

1 open finding
3 resolved since last review

🧠 Review effort: Balanced

@laeubi

laeubi commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

@SougandhS I'm a bit in doubt the user will really understand the meaning, also one might wonder what if there are multiple entries? e.g. select a bundle and open the menu gives me

grafik

What one will your new option apply to? Will it open (and create!) all of them? Also there are probably cases where there is only a temporary run created (or invisible to the user)...

What do you think of instead using a modifier key (E.g. CTRL or ALT) that performs the action when holding down during a click?

@SougandhS

Copy link
Copy Markdown
Contributor Author

@SougandhS I'm a bit in doubt the user will really understand the meaning, also one might wonder what if there are multiple entries? e.g. select a bundle and open the menu gives me

I have added an selection dialog when there are multiple configs

What one will your new option apply to? Will it open (and create!) all of them

WIll create only the one selected..

What do you think of instead using a modifier key (E.g. CTRL or ALT) that performs the action when holding down during a click?

That sounds great 👍

@laeubi

laeubi commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Updated 👍 image

For your current proposal: From the screenshot it would feels more natural having the one with ... directly under the entry instead of far away from the original one (that can contain recent (customized) launch entries as well.

Also semantically I see a little bit of a problem as the Run As is a shortcut and the provider of that shortcut has deliberately decided to run it right now. e.g. m2e offers this shortcut here to open the config dialog

grafik

so maybe it would be worth to simply make the shortcut provider offering an alternative item (if they want) as this would then likely for the m2e case would even duplicate this entry (and some have already complained the list is quite long).

We can make it more convenient that case so one can mark a shortcut to offer both in plugin.xml so one just need to opt-in for this behavior.

@SougandhS

Copy link
Copy Markdown
Contributor Author

We can make it more convenient that case so one can mark a shortcut to offer both in plugin.xml so one just need to opt-in for this behavior.

I'll try to work on this implementation, this way there wont be much complications 👍

@iloveeclipse

Copy link
Copy Markdown
Member

Doesn't work if there are multiple different targets and looks not nice because everything is doubled.
What about holding "Shift" to get each already existing menu to have extra dots and start config dialog instead of adding new menus?

image

Trying the "OSGI Framework..." opens "JUnit" config.

image

Ctrl+click (Cmd+click on macOS) on any Run As / Debug As shortcut entry
now opens the Run/Debug Configurations dialog.
@SougandhS
SougandhS marked this pull request as draft October 14, 2026 14:31
@SougandhS
SougandhS marked this pull request as ready for review October 14, 2026 14:33
@SougandhS

Copy link
Copy Markdown
Contributor Author

What about holding "Shift" to get each already existing menu to have extra dots and start config dialog instead of adding new menus

I tried a new implementation -> Cmd/Ctrl + click on existing list -
image
will create launch config specific to that config type
image

In this way there's no doubled entries & shortcuts..
@laeubi @iloveeclipse WDYT ?

@SougandhS SougandhS changed the title Add "Configure Before Launch.." to Run As / Debug As menu Open launch config dialog on Ctrl/cmd+click on launch shortcuts in Run As / Debug As menu Oct 14, 2026
@laeubi

laeubi commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

There sees to be a related work here now:

@anydoby

anydoby commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Good evening, keyboard dude coming here from the #3075 :)

My pain is actually lengthy navigation around run as / debug as with the mouse, so I came up with a simple shortcut (see that PR) that will open in a searchable/filterable dialog what the launch shortcut providers supply. I just type faster than navigate with the mouse, but the mechanism is the same: contributors based on current file type AND selection feed the context menu or the dialog.

@laeubi s idea above (or below in the new interface :) ) that a shortcut provider can offer extra entries is similar to something i was preparing for the v2 of my dialog: a little api extension anydoby/eclipse.platform@run-as-dialog...launch-choice-providers. A provider belongs to one launch shortcut and gives extra entries for the current editor, for example "JUnit Test: CalculatorTest.adds()" for the test method at the cursor. Each entry has a label, an image and a launch action.
Could the same mechanism serve this PR? A shortcut provider could give its "JUnit Test..." (configure before the first launch) entry the same way, and the menu and the dialog would show the same extra entries.

What do you think?

@anydoby

anydoby commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

i'm still changing that branch's code here and there but the general idea is implemented. There's only a test implementation of ILaunchChoiceProvider that demonstrates the purpose. I have a plugin that works already on my machine that shows the dialog with run options for a specific selection, works with rust and java. It also works in CDT for C files, but choices list in very basic. For best results we need extensions for all languages. The idea is to do it through the choice provider for all languages supported. For languages that use LSP4E calls can be slow, so we can now add default methods to ILaunchChoiceProvider like so:

default CompletableFuture<List<LaunchChoice>> getChoicesAsync(IEditorPart editor,
        ILaunchShortcut shortcut, String mode) {
    return CompletableFuture.completedFuture(getChoices(editor, shortcut, mode));
}

the implementations are then free to either leave it as (synchronous if its fast) is or add a lazy loadable launch configurations list. Would only work reliably in an items list (in a dialog), not in an SWT menu though; so I'm still hesitating whether it should be part of the API from the start. On the other hand its always good to have an API ready for extension :)

@SougandhS

Copy link
Copy Markdown
Contributor Author

@anydoby Cool feature btw 🎉(#3075)

The idea of my PR (#3021) is provide a choice to configure a launch prior launching it. Maybe this idea can be included in #3075
eg,
image

@anydoby

anydoby commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Hey @SougandhS, I'll implement this Configure in my plugin for now, just for the demo. And when you've merged your PR, i will rewrite it to use the new API. The dialog will run on Enter, and open the Configure on ctrl+Enter, oki? Feels symmetrical with the ctrl+click.

You can check out the configure button in the plugin: https://anydoby.com/eclipse, v1.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants